﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Nok_Air
{
    public partial class AppBarMenuUserControl : UserControl
    {
        public bool isFirstPage {
            get { return !nokAppButton.IsEnabled; }
            set { nokAppButton.IsEnabled = !value; }
        }
        [System.ComponentModel.Description("Set list of ImageSource to display in the slider."), System.ComponentModel.Category("Common Properties")]
        public static readonly DependencyProperty isFirstPageProperty = DependencyProperty.Register("isFirstPage", typeof(bool), typeof(AppBarMenuUserControl), new PropertyMetadata(false, new PropertyChangedCallback(isFirstPageChanged)));
        private static void isFirstPageChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e) { }

        public AppBarMenuUserControl()
        {
            InitializeComponent();
            DataContext = new Wording().abar;
        }

        private void languageButton_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            App.isChangeLang = App.isChangeLang == "true" ? "false" : "true";

            if (App.isChangeLang == "true")
            {
                MessageBox.Show(new Wording().abar.Message);
            }
            else {
                //Swap display message then return present lang.
                App.lang = App.lang == "eng" ? "thai" : "eng";
                MessageBox.Show(new Wording().abar.Message);
                App.lang = App.lang == "eng" ? "thai" : "eng";
            }
        }
    }
}
